package com.codeman.business.book.domain;

import java.util.Date;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.codeman.common.annotation.Excel;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 小说对象 book
 * 
 * @author codeman
 * @date 2021-03-19
 */
@Data
public class Book
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /** 作品方向 */
    @Excel(name = "作品方向")
    private String workDirection;

    /** 分类ID */
    private Integer catId;

    /** 分类名 */
    private String catName;

    /** 小说封面 */
    private String picUrl;

    /** 小说名 */
    @Excel(name = "小说名")
    private String bookName;

    /** 作者id，预留字段 */
    private Long authorId;

    /** 作者名 */
    @Excel(name = "作者名")
    private String authorName;

    /** 书籍描述 */
    private String bookDesc;

    /** 评分，预留字段 */
    private Float score;

    /** 书籍状态，0：连载中，1：已完结 */
    private String bookStatus;

    /** 点击量 */
    @Excel(name = "点击量")
    private Long visitCount;

    /** 总字数 */
    @Excel(name = "总字数")
    private Integer wordCount;

    /** 评论数 */
    private Integer commentCount;

    /** 最新目录ID */
    private Long lastIndexId;

    /** 最新目录名 */
    private String lastIndexName;

    /** 最新目录更新时间 */
    private Date lastIndexUpdateTime;

    /** 是否收费 */
    @Excel(name = "是否收费")
    private String isVip;

    /** 上架状态 */
    private String shelvesStatus;

    /** 爬虫源站ID */
    private Integer crawlSourceId;

    /** 抓取的源站小说ID */
    private String crawlBookId;

    /** 最后一次的抓取时间 */
    private Date crawlLastTime;

    /** 是否停更 */
    @Excel(name = "是否停更")
    private String crawlIsStop;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("workDirection", getWorkDirection())
            .append("catId", getCatId())
            .append("catName", getCatName())
            .append("picUrl", getPicUrl())
            .append("bookName", getBookName())
            .append("authorId", getAuthorId())
            .append("authorName", getAuthorName())
            .append("bookDesc", getBookDesc())
            .append("score", getScore())
            .append("bookStatus", getBookStatus())
            .append("visitCount", getVisitCount())
            .append("wordCount", getWordCount())
            .append("commentCount", getCommentCount())
            .append("lastIndexId", getLastIndexId())
            .append("lastIndexName", getLastIndexName())
            .append("lastIndexUpdateTime", getLastIndexUpdateTime())
            .append("isVip", getIsVip())
            .append("shelvesStatus", getShelvesStatus())
            .append("updateTime", getUpdateTime())
            .append("createTime", getCreateTime())
            .append("crawlSourceId", getCrawlSourceId())
            .append("crawlBookId", getCrawlBookId())
            .append("crawlLastTime", getCrawlLastTime())
            .append("crawlIsStop", getCrawlIsStop())
            .toString();
    }
}
